by Devin Yang

建立於: 6年前 ( 更新: 6年前 )

本文使用的CentOS 6.2進行,進行重build curl及git過程。
主因是因為作業系統太舊,我想直接由source build最新版本的git。
cat /etc/redhat-release
CentOS release 6.2 (Final)

但進行下方指令時,出現了 SSL connect error的錯誤。
git clone https://github.com/git/git.git

因為舊版的CentOS,所以網路提供的方式..
yum update -y nss curl
的更新方式無效了,
所以..我就自己重Build curl。
先在另一台電腦,clone,最新版本的curl。
git clone https://github.com/curl/curl

依其說明,查看GIT-INFO檔,如何編譯。
我執行
./buildconf
./configure
make

就順順利利的編譯完curl了。接著使用make install直接安裝。
完成後,重試git repo的下載(註: 其實到可以到release下載釋出的版本)
[root@myserver src]# git clone https://github.com/git/git.git
Cloning into 'git'...
remote: Counting objects: 247464, done.
remote: Total 247464 (delta 0), reused 0 (delta 0), pack-reused 247463
Receiving objects: 100% (247464/247464), 90.42 MiB | 1.16 MiB/s, done.
Resolving deltas: 100% (182891/182891), done.
Checking connectivity... done.

順立clone了git的source囉.
進入git的repo資料夾。
依README.md說明,查看INSTALL檔,如何安裝。
$ make configure ;# as yourself
$ ./configure --prefix=/usr ;# as yourself
$ make all doc ;# as yourself
# make install install-doc install-html;# as root

果真,按步施工,保證成功。但我只單純進行如下動作。打了./configure,不設定prefix。
make configure
./configure
make
make install

就搞定囉,但是,發覺,疑版本是rc1版本。
[root@myserver git]# which git
/usr/local/bin/git
[root@myserver git]# git --version
git version 2.18.0.rc1

雖然是RC的版本了,基本上不太會有問題才對,看起來滿正常的..:)
[root@myserver src]# git clone https://github.com/DevinY/dlaravel.git
Cloning into 'dlaravel'...
remote: Counting objects: 1456, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 1456 (delta 27), reused 42 (delta 16), pack-reused 1398
Receiving objects: 100% (1456/1456), 3.03 MiB | 948.00 KiB/s, done.
Resolving deltas: 100% (866/866), done.

想想後,我又重build了2.17.1版了,這次到release處透過wget下載,並解壓縮重build。

簡單的用,
./configure
make
make install
最後畫面如下搞定囉,安裝了2.17.1版啦。
		rm -f "$execdir/$p" && \
		test -z "" && \
		ln "$execdir/git-remote-http" "$execdir/$p" 2>/dev/null || \
		ln -s "git-remote-http" "$execdir/$p" 2>/dev/null || \
		cp "$execdir/git-remote-http" "$execdir/$p" || exit; \
	done && \
	./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"
[root@myserver git-2.17.1]# which git
/usr/local/bin/git
[root@myserver git-2.17.1]# git --version
git version 2.17.1
[root@myserver git-2.17.1]#
以上即是這次我在舊版本CentOS 6.2更新git的過程。
 

Tags: linux

Devin Yang

文章內容無法一一說明,如果您有什麼不了解處,歡迎提問哦:)

No Comment

Post your comment

需要登入才可留言!

類似的文章


linux,docker,wifi

用docker建立WPA2/EAP企業用Radius驗證伺服器,後端使用mysql資料庫

AP提供了WPA2/EAP功能,但不會用嗎? 本文介紹我如何透過docker的ubuntu:21.04 image,極速建立Radius伺服器, 與Wifi的WPA2/EAP等相關運用。

linux

Raspberry Pi 3 樹莓派作業系統安裝

這篇文章,分享使用MacOS上的內建指令,進行Raspberry Pi的作業系統安裝。 在這個安裝過程中關於dd指令,請小心指定您of的參數,即是write output到檔案的位置, 指定錯了,會毀掉自己的系統哦。

linux, mac, terminal, tips

再Linux或Mac的終端機如何清除目前的命令列的輸入?

再Linux或Mac的終端機如何清除目前的命令列? 例如打錯了一堆指令,打錯了想清除從打, 千萬要跟我以前一樣,用倒退鍵慢慢殺了,我們可以用......